home *** CD-ROM | disk | FTP | other *** search
/ HaCKeRz Kr0nlcKLeZ 1 / HaCKeRz Kr0nlcKLeZ.iso / chibacity / gbbdisk.arj / PROTMODE / TABLES.ASM < prev    next >
Encoding:
Assembly Source File  |  1995-08-03  |  4.7 KB  |  106 lines

  1. ;*******************************************************************************
  2. ; Tables for use in protected mode, including the GDT, IDT, and relevant TSS's *
  3. ;*******************************************************************************
  4.  
  5. ;For use with V86.ASM, etc.
  6.  
  7. ;(C) 1993 American Eagle Publications, Inc., All rights reserved!
  8.  
  9. ;A GDT entry has the following form:
  10. ;               DW      ?                       ;segment limit
  11. ;               DB      ?,?,?                   ;24 bits of absolute address
  12. ;               DB      ?                       ;access rights
  13. ;               DB      ?                       ;extended access rights
  14. ;               DB      ?                       ;high 8 bits of 32 bit absolute address
  15.  
  16. GDT             DQ      0                       ;First GDT entry must be 0
  17.  
  18.                 DW      0FFFFH                  ;BIOS data selector (at 0:0)
  19.                 DB      0,0,0
  20.                 DB      TYP_READ_WRITE or DTYPE_MEMORY or DPL_0 or PRESENT
  21.                 DB      GRANULAR_4K             ;you can get at any @ in low memory with this
  22.                 DB      0
  23.  
  24.                 DW      TSS_Size                ;TSS for task 1 (startup)
  25.                 DW      OFFSET TSS_1
  26.                 DB      11H
  27.                 DB      TYP_TASK or DPL_0 or PRESENT
  28.                 DB      0,0
  29.  
  30.                 DW      0FFFFH                  ;Task 1 code segment selector
  31.                 DB      0,0,11H                 ;starts at 110000H
  32.                 DB      TYP_EXEC_READ or DTYPE_MEMORY or DPL_0 or PRESENT
  33.                 DB      TYPE_32,0
  34.  
  35.                 DW      0FFFFH                  ;Task 1 data selector
  36.                 DB      0,0,11H                 ;at 110000H
  37.                 DB      TYP_READ_WRITE or DTYPE_MEMORY or DPL_0 or PRESENT
  38.                 DB      TYPE_32,0
  39.  
  40.                 DW      TSS_Size+IOMAP_SIZE     ;TSS for task 2
  41.                 DW      OFFSET TSS_2
  42.                 DB      11H
  43.                 DB      TYP_TASK or DPL_3 or PRESENT
  44.                 DW      0
  45.  
  46. ;End of GDT
  47.  
  48. ;This is the task state segment for the virtual machine
  49. TSS_2           DW      0               ;back link
  50.                 DW      0               ;filler
  51.                 DD      TASK2_STACK0+STACK_SIZE   ;esp0
  52.                 DW      DATA_1_SEL      ;ss0
  53.                 DW      0               ;filler
  54.                 DD      TASK2_STACK1+STACK_SIZE   ;esp1
  55.                 DW      DATA_1_SEL      ;ss1
  56.                 DW      0               ;filler
  57.                 DD      TASK2_STACK2+STACK_SIZE   ;esp2
  58.                 DW      DATA_1_SEL      ;ss2
  59.                 DW      0               ;filler
  60. TSS2_CR3        DD      118000H         ;cr3
  61.                 DD      OFFSET VIRTUAL  ;eip
  62.                 DD      23000H          ;eflags (IOPL 3)
  63.                 DD      0               ;eax
  64.                 DD      0               ;ecx
  65.                 DD      0               ;edx
  66.                 DD      0               ;ebx
  67.                 DD      STACK_SIZE      ;esp
  68.                 DD      0               ;ebp
  69.                 DD      0               ;esi
  70.                 DD      0               ;edi
  71.                 DW      0               ;es
  72.                 DW      0               ;filler
  73. TSS2_CS         DW      0               ;cs
  74.                 DW      0               ;filler
  75. TSS2_SS         DW      0               ;ss
  76.                 DW      0               ;filler
  77.                 DW      0               ;ds
  78.                 DW      0               ;filler
  79.                 DW      0               ;fs
  80.                 DW      0               ;filler
  81.                 DW      0               ;gs
  82.                 DW      0               ;filler
  83.                 DW      0               ;ldt
  84.                 DW      0               ;filler
  85.                 DW      0               ;exception on task switch bit
  86.                 DW      OFFSET TSS2IO - OFFSET TSS_2   ;iomap offfset pointer
  87.  
  88. TSS2IO          DB      IOMAP_SIZE-1 dup (0)    ;io map for task 2
  89.                 DB      0FFH                    ;dummy byte for end of io map
  90.  
  91.  
  92. TASK_GATE_2     DD      0
  93.                 DW      TSS_2_SEL
  94.  
  95. IDT             DW      OFFSET NOT_IMPLEMENTED          ;low part of offset
  96.                 DW      CODE_1_SEL                      ;code segment selector
  97.                 DB      0,PRESENT or DPL_0 or INTERRUPT_GATE    ;interrupt control flags
  98.                 DW      0                               ;high part of offset
  99.  
  100.                 DB      (IDT_Entries-1)*8   dup (?)     ;IDT table space
  101.  
  102.  
  103. ;This is the task state segment for the virtual machine monitor
  104. TSS_1           DB      TSS_Size dup (?)            ;TSS space for task 1 (V86 monitor)
  105.  
  106.